package ma.platform.server.upms.rpc;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import jakarta.annotation.Resource;
import ma.platform.server.core.util.R;
import ma.platform.server.upms.api.entity.SysOauthClientDetails;
import ma.platform.server.upms.api.rpc.RemoteClientDetailsService;
import ma.platform.server.upms.service.SysOauthClientDetailsService;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

/**
 * Copyright:
 * Author:
 * Description:
 * Created by 李林山 on 2024/8/18
 */
@Component
public class RemoteClientDetailsServiceImpl implements RemoteClientDetailsService {

    @Resource
    private SysOauthClientDetailsService clientDetailsService;

    @Override
    public R<SysOauthClientDetails> getClientDetailsById(String clientId) {
        return R.ok(clientDetailsService.getOne(
                Wrappers.<SysOauthClientDetails>lambdaQuery().eq(SysOauthClientDetails::getClientId, clientId), false));
    }
}
